<%@page import="com.yunhuakeji.wddx.utils.IsNull"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="net.sf.json.JSONObject"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
JSONObject result;
try{
	result = JSONObject.fromObject(request.getAttribute("result"));
	System.out.println(result);
}
catch (Exception e) {
	e.printStackTrace();
	result = null;
	}
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>借阅报告</title>
     <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no,minimum-scale=1.0,maximum-scale=1.0">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="css/myreport.css">
	<link rel="stylesheet" type="text/css" href="css/selectStyle.css">
	<script src="js/jquery.min.js"></script>
	<script src="js/selectCustom.js"></script>
	<script src="js/highcharts.js"></script>
	<script src="js/myReport.js"></script>
  </head>
  
  <body>
  <%if(IsNull.isNotNull(result.toString())){ %>
    	<div class="report-header">
    		<div class="report-header-container">
    			<div class="report-col-1 pl5 pr5">< </div>
    			<!-- <div class="report-col-8 pl5 pr5">
    					<a class="color-white">借阅报告</a>
    			</div> -->
    			<div class="report-col-1 pl5 pr5"></div>
    		</div>
    		<div class="clear"></div>
    	</div>
    	<div class="report-menu">
    		<div class="border-bot-dotted">
    			<div>本学期共计借阅<span class="color-red"><%=result.getString("total") %></span>次</div>
    			<div class="mt20 text-center">
    				<div class="mt20"><a>课程通过率分析</a></div>
    				<div class="mt20" id="tglPic">
    					<img src="images/cjbg_01.png">
    					<img src="images/cjbg_01.png">
    					<img src="images/cjbg_01.png">
    					<img src="images/cjbg_01.png">
    					<img src="images/cjbg_01.png">
    					<img src="images/cjbg_03.png">
    					<img src="images/cjbg_03.png">
    					<img src="images/cjbg_03.png">
    					<img src="images/cjbg_03.png">
    					<img src="images/cjbg_03.png">
    				</div >
    				<div class="mt20"><a>你的借阅水平高于全校<span class="color-red"><%=result.getString("pm") %></span>的同学</a></div>
    				<div class="mt20 text-left gray">结论 : <%=result.getJSONArray("describe").getString(0) %></div>
    			</div>
    		</div>
    		<div>
    			<div class="mt10 text-center">
    				<div><a>借阅类型分析</a></div>
    				<div id="jychart"></div>
    				<div class="text-left gray">结论 : <%=result.getJSONArray("describe").getString(1) %></div>
    			</div>
    		</div>
    	</div>
  
  <script>
  
  	var user_id = '<%=request.getParameter("userid")%>';
	var user_name = '<%=session.getAttribute("username")%>';
	var faceaddress = '<%=session.getAttribute("faceaddress")%>';
	var ticket = '<%=request.getParameter("ticket")%>';
	
 //创建myreport对象
 var report = new myReport();
 //修改下拉选框的样式
 $(".custom").selectCustom({'divclasses':'position-absolute-center'});
//获取饼图数据
var datas = {format:'',data:'',pointFormat:'',domId:''};
 		datas.format = "{point.name}: {point.y}本";
 		datas.pointFormat = "总数: {point.y}本 <br>{series.name}:{point.percentage:.1f}%<br>";
 		datas.data = <%=result.getJSONObject("pie_data").getJSONArray("series_data")%>;
 		datas.domId = "jychart";
 		report.createChart(datas);
 //控制课程通过率百分比
  var tgl='<%=result.getString("pm")%>'; 
 var imgs = $("#tglPic img");
 report.setTglPic(imgs,tgl); 
  </script>
   <%}else{ %>
       <div class="noData">
            <img alt="" src="img/noData.png">
            <div class="mt20">暂无数据</div>
       </div>
   <%} %>
  </body>
</html>
